import request from '@/utils/request'

// 查询委托列表
export function listCommissionAll(query) {
  return request({
    url: '/commission/commission/listAll',
    method: 'get',
    params: query
  })
}

// 查询委托列表
export function listCommission(query) {
  return request({
    url: '/commission/commission/list',
    method: 'get',
    params: query
  })
}

// 查询委托详细
export function getCommission(id) {
  return request({
    url: '/commission/commission/' + id,
    method: 'get'
  })
}

// 新增委托
export function addCommission(data) {
  return request({
    url: '/commission/commission',
    method: 'post',
    data: data
  })
}

// 修改委托
export function updateCommission(data) {
  return request({
    url: '/commission/commission',
    method: 'put',
    data: data
  })
}

// 删除委托
export function delCommission(id) {
  return request({
    url: '/commission/commission/' + id,
    method: 'delete'
  })
}
// 删除委托
export function logicDelCommission(id) {
  return request({
    url: '/commission/commission/' + id,
    method: 'delete'
  })
}

// 导出委托
export function exportCommission(query) {
  return request({
    url: '/commission/commission/export',
    method: 'get',
    params: query
  })
}


// 试验完结
export function updateDone(commissionId) {
  return request({
    url: '/commission/commission/updateDone?commissionId='+commissionId,
    method: 'post'
  })
}

// 项目完结
export function updateDoneTrue(commissionId) {
  return request({
    url: '/commission/commission/updateDoneTrue?commissionId='+commissionId,
    method: 'post'
  })
}



export function getEngineeringInfo(engineering) {
  return request({
    url: '/commission/commission/getEngineeringInfo/' + engineering,
    method: 'get'
  })
}